Optimal. Leaf size=205 \[ \frac {3 e^{-i d} f^a \sqrt {\pi } \text {Erf}\left (x \sqrt {i f-c \log (f)}\right )}{16 \sqrt {i f-c \log (f)}}+\frac {e^{-3 i d} f^a \sqrt {\pi } \text {Erf}\left (x \sqrt {3 i f-c \log (f)}\right )}{16 \sqrt {3 i f-c \log (f)}}+\frac {3 e^{i d} f^a \sqrt {\pi } \text {Erfi}\left (x \sqrt {i f+c \log (f)}\right )}{16 \sqrt {i f+c \log (f)}}+\frac {e^{3 i d} f^a \sqrt {\pi } \text {Erfi}\left (x \sqrt {3 i f+c \log (f)}\right )}{16 \sqrt {3 i f+c \log (f)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.20, antiderivative size = 205, normalized size of antiderivative = 1.00, number of steps
used = 10, number of rules used = 4, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {4561, 2325,
2236, 2235} \begin {gather*} \frac {3 \sqrt {\pi } e^{-i d} f^a \text {Erf}\left (x \sqrt {-c \log (f)+i f}\right )}{16 \sqrt {-c \log (f)+i f}}+\frac {\sqrt {\pi } e^{-3 i d} f^a \text {Erf}\left (x \sqrt {-c \log (f)+3 i f}\right )}{16 \sqrt {-c \log (f)+3 i f}}+\frac {3 \sqrt {\pi } e^{i d} f^a \text {Erfi}\left (x \sqrt {c \log (f)+i f}\right )}{16 \sqrt {c \log (f)+i f}}+\frac {\sqrt {\pi } e^{3 i d} f^a \text {Erfi}\left (x \sqrt {c \log (f)+3 i f}\right )}{16 \sqrt {c \log (f)+3 i f}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2235
Rule 2236
Rule 2325
Rule 4561
Rubi steps
\begin {align*} \int f^{a+c x^2} \cos ^3\left (d+f x^2\right ) \, dx &=\int \left (\frac {3}{8} e^{-i d-i f x^2} f^{a+c x^2}+\frac {3}{8} e^{i d+i f x^2} f^{a+c x^2}+\frac {1}{8} e^{-3 i d-3 i f x^2} f^{a+c x^2}+\frac {1}{8} e^{3 i d+3 i f x^2} f^{a+c x^2}\right ) \, dx\\ &=\frac {1}{8} \int e^{-3 i d-3 i f x^2} f^{a+c x^2} \, dx+\frac {1}{8} \int e^{3 i d+3 i f x^2} f^{a+c x^2} \, dx+\frac {3}{8} \int e^{-i d-i f x^2} f^{a+c x^2} \, dx+\frac {3}{8} \int e^{i d+i f x^2} f^{a+c x^2} \, dx\\ &=\frac {1}{8} \int \exp \left (-3 i d+a \log (f)-x^2 (3 i f-c \log (f))\right ) \, dx+\frac {1}{8} \int \exp \left (3 i d+a \log (f)+x^2 (3 i f+c \log (f))\right ) \, dx+\frac {3}{8} \int e^{-i d+a \log (f)-x^2 (i f-c \log (f))} \, dx+\frac {3}{8} \int e^{i d+a \log (f)+x^2 (i f+c \log (f))} \, dx\\ &=\frac {3 e^{-i d} f^a \sqrt {\pi } \text {erf}\left (x \sqrt {i f-c \log (f)}\right )}{16 \sqrt {i f-c \log (f)}}+\frac {e^{-3 i d} f^a \sqrt {\pi } \text {erf}\left (x \sqrt {3 i f-c \log (f)}\right )}{16 \sqrt {3 i f-c \log (f)}}+\frac {3 e^{i d} f^a \sqrt {\pi } \text {erfi}\left (x \sqrt {i f+c \log (f)}\right )}{16 \sqrt {i f+c \log (f)}}+\frac {e^{3 i d} f^a \sqrt {\pi } \text {erfi}\left (x \sqrt {3 i f+c \log (f)}\right )}{16 \sqrt {3 i f+c \log (f)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 2.36, size = 389, normalized size = 1.90 \begin {gather*} \frac {\sqrt [4]{-1} f^a \sqrt {\pi } \left (3 \text {Erfi}\left (\sqrt [4]{-1} x \sqrt {f-i c \log (f)}\right ) \sqrt {f-i c \log (f)} \left (-9 i f^3+9 c f^2 \log (f)-i c^2 f \log ^2(f)+c^3 \log ^3(f)\right ) (\cos (d)+i \sin (d))+(f-i c \log (f)) \left (-\left ((3 f-i c \log (f)) \left (9 f \text {Erf}\left (\frac {(1+i) x \sqrt {f+i c \log (f)}}{\sqrt {2}}\right ) \sqrt {f+i c \log (f)} \sin (d)+3 \text {Erfi}\left ((-1)^{3/4} x \sqrt {f+i c \log (f)}\right ) \sqrt {f+i c \log (f)} (\cos (d) (3 f+i c \log (f))+c \log (f) \sin (d))+\text {Erfi}\left ((-1)^{3/4} x \sqrt {3 f+i c \log (f)}\right ) (f+i c \log (f)) \sqrt {3 f+i c \log (f)} (\cos (3 d)-i \sin (3 d))\right )\right )+\text {Erfi}\left (\sqrt [4]{-1} x \sqrt {3 f-i c \log (f)}\right ) \sqrt {3 f-i c \log (f)} \left (-3 i f^2+4 c f \log (f)+i c^2 \log ^2(f)\right ) (\cos (3 d)+i \sin (3 d))\right )\right )}{16 \left (9 f^4+10 c^2 f^2 \log ^2(f)+c^4 \log ^4(f)\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.56, size = 162, normalized size = 0.79
method | result | size |
risch | \(\frac {\sqrt {\pi }\, f^{a} {\mathrm e}^{-3 i d} \erf \left (x \sqrt {3 i f -c \ln \left (f \right )}\right )}{16 \sqrt {3 i f -c \ln \left (f \right )}}+\frac {3 \sqrt {\pi }\, f^{a} {\mathrm e}^{-i d} \erf \left (x \sqrt {i f -c \ln \left (f \right )}\right )}{16 \sqrt {i f -c \ln \left (f \right )}}+\frac {3 \sqrt {\pi }\, f^{a} {\mathrm e}^{i d} \erf \left (\sqrt {-c \ln \left (f \right )-i f}\, x \right )}{16 \sqrt {-c \ln \left (f \right )-i f}}+\frac {\sqrt {\pi }\, f^{a} {\mathrm e}^{3 i d} \erf \left (\sqrt {-c \ln \left (f \right )-3 i f}\, x \right )}{16 \sqrt {-c \ln \left (f \right )-3 i f}}\) | \(162\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 667 vs. \(2 (145) = 290\).
time = 0.30, size = 667, normalized size = 3.25 \begin {gather*} \frac {\sqrt {\pi } \sqrt {2 \, c^{2} \log \left (f\right )^{2} + 18 \, f^{2}} {\left ({\left ({\left (-i \, c^{2} \cos \left (3 \, d\right ) - c^{2} \sin \left (3 \, d\right )\right )} f^{a} \log \left (f\right )^{2} + f^{a + 2} {\left (-i \, \cos \left (3 \, d\right ) - \sin \left (3 \, d\right )\right )}\right )} \operatorname {erf}\left (\sqrt {-c \log \left (f\right ) + 3 i \, f} x\right ) + {\left ({\left (i \, c^{2} \cos \left (3 \, d\right ) - c^{2} \sin \left (3 \, d\right )\right )} f^{a} \log \left (f\right )^{2} + f^{a + 2} {\left (i \, \cos \left (3 \, d\right ) - \sin \left (3 \, d\right )\right )}\right )} \operatorname {erf}\left (\sqrt {-c \log \left (f\right ) - 3 i \, f} x\right )\right )} \sqrt {c \log \left (f\right ) + \sqrt {c^{2} \log \left (f\right )^{2} + 9 \, f^{2}}} + 3 \, \sqrt {\pi } \sqrt {2 \, c^{2} \log \left (f\right )^{2} + 2 \, f^{2}} {\left ({\left ({\left (-i \, c^{2} \cos \left (d\right ) - c^{2} \sin \left (d\right )\right )} f^{a} \log \left (f\right )^{2} + 9 \, f^{a + 2} {\left (-i \, \cos \left (d\right ) - \sin \left (d\right )\right )}\right )} \operatorname {erf}\left (\sqrt {-c \log \left (f\right ) + i \, f} x\right ) + {\left ({\left (i \, c^{2} \cos \left (d\right ) - c^{2} \sin \left (d\right )\right )} f^{a} \log \left (f\right )^{2} + 9 \, f^{a + 2} {\left (i \, \cos \left (d\right ) - \sin \left (d\right )\right )}\right )} \operatorname {erf}\left (\sqrt {-c \log \left (f\right ) - i \, f} x\right )\right )} \sqrt {c \log \left (f\right ) + \sqrt {c^{2} \log \left (f\right )^{2} + f^{2}}} + \sqrt {\pi } \sqrt {2 \, c^{2} \log \left (f\right )^{2} + 18 \, f^{2}} {\left ({\left ({\left (c^{2} \cos \left (3 \, d\right ) - i \, c^{2} \sin \left (3 \, d\right )\right )} f^{a} \log \left (f\right )^{2} + f^{a + 2} {\left (\cos \left (3 \, d\right ) - i \, \sin \left (3 \, d\right )\right )}\right )} \operatorname {erf}\left (\sqrt {-c \log \left (f\right ) + 3 i \, f} x\right ) + {\left ({\left (c^{2} \cos \left (3 \, d\right ) + i \, c^{2} \sin \left (3 \, d\right )\right )} f^{a} \log \left (f\right )^{2} + f^{a + 2} {\left (\cos \left (3 \, d\right ) + i \, \sin \left (3 \, d\right )\right )}\right )} \operatorname {erf}\left (\sqrt {-c \log \left (f\right ) - 3 i \, f} x\right )\right )} \sqrt {-c \log \left (f\right ) + \sqrt {c^{2} \log \left (f\right )^{2} + 9 \, f^{2}}} + 3 \, \sqrt {\pi } \sqrt {2 \, c^{2} \log \left (f\right )^{2} + 2 \, f^{2}} {\left ({\left ({\left (c^{2} \cos \left (d\right ) - i \, c^{2} \sin \left (d\right )\right )} f^{a} \log \left (f\right )^{2} + 9 \, f^{a + 2} {\left (\cos \left (d\right ) - i \, \sin \left (d\right )\right )}\right )} \operatorname {erf}\left (\sqrt {-c \log \left (f\right ) + i \, f} x\right ) + {\left ({\left (c^{2} \cos \left (d\right ) + i \, c^{2} \sin \left (d\right )\right )} f^{a} \log \left (f\right )^{2} + 9 \, f^{a + 2} {\left (\cos \left (d\right ) + i \, \sin \left (d\right )\right )}\right )} \operatorname {erf}\left (\sqrt {-c \log \left (f\right ) - i \, f} x\right )\right )} \sqrt {-c \log \left (f\right ) + \sqrt {c^{2} \log \left (f\right )^{2} + f^{2}}}}{32 \, {\left (c^{4} \log \left (f\right )^{4} + 10 \, c^{2} f^{2} \log \left (f\right )^{2} + 9 \, f^{4}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 311 vs. \(2 (145) = 290\).
time = 2.02, size = 311, normalized size = 1.52 \begin {gather*} -\frac {\sqrt {\pi } {\left (c^{3} \log \left (f\right )^{3} - 3 i \, c^{2} f \log \left (f\right )^{2} + c f^{2} \log \left (f\right ) - 3 i \, f^{3}\right )} \sqrt {-c \log \left (f\right ) - 3 i \, f} \operatorname {erf}\left (\sqrt {-c \log \left (f\right ) - 3 i \, f} x\right ) e^{\left (a \log \left (f\right ) + 3 i \, d\right )} + 3 \, \sqrt {\pi } {\left (c^{3} \log \left (f\right )^{3} - i \, c^{2} f \log \left (f\right )^{2} + 9 \, c f^{2} \log \left (f\right ) - 9 i \, f^{3}\right )} \sqrt {-c \log \left (f\right ) - i \, f} \operatorname {erf}\left (\sqrt {-c \log \left (f\right ) - i \, f} x\right ) e^{\left (a \log \left (f\right ) + i \, d\right )} + 3 \, \sqrt {\pi } {\left (c^{3} \log \left (f\right )^{3} + i \, c^{2} f \log \left (f\right )^{2} + 9 \, c f^{2} \log \left (f\right ) + 9 i \, f^{3}\right )} \sqrt {-c \log \left (f\right ) + i \, f} \operatorname {erf}\left (\sqrt {-c \log \left (f\right ) + i \, f} x\right ) e^{\left (a \log \left (f\right ) - i \, d\right )} + \sqrt {\pi } {\left (c^{3} \log \left (f\right )^{3} + 3 i \, c^{2} f \log \left (f\right )^{2} + c f^{2} \log \left (f\right ) + 3 i \, f^{3}\right )} \sqrt {-c \log \left (f\right ) + 3 i \, f} \operatorname {erf}\left (\sqrt {-c \log \left (f\right ) + 3 i \, f} x\right ) e^{\left (a \log \left (f\right ) - 3 i \, d\right )}}{16 \, {\left (c^{4} \log \left (f\right )^{4} + 10 \, c^{2} f^{2} \log \left (f\right )^{2} + 9 \, f^{4}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int f^{a + c x^{2}} \cos ^{3}{\left (d + f x^{2} \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int f^{c\,x^2+a}\,{\cos \left (f\,x^2+d\right )}^3 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________